module(
    name = "rules_mojo",
    version = "0.2.0",
    bazel_compatibility = [">=8.0.0"],
)

bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "platforms", version = "0.0.11")
bazel_dep(name = "rules_cc", version = "0.1.1")
bazel_dep(name = "rules_python", version = "1.0.0")

mojo = use_extension("//mojo:extensions.bzl", "mojo")
mojo.toolchain()
use_repo(mojo, "mojo_toolchains")

register_toolchains("@mojo_toolchains//...")

_DEFAULT_PYTHON_VERSION = "3.12"

python = use_extension("@rules_python//python/extensions:python.bzl", "python", dev_dependency = True)
python.toolchain(
    ignore_root_user_error = True,
    is_default = True,
    python_version = _DEFAULT_PYTHON_VERSION,
)

pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip", dev_dependency = True)
pip.parse(
    hub_name = "rules_mojo_test_deps",
    python_version = _DEFAULT_PYTHON_VERSION,
    requirements_lock = "tests/python/requirements.txt",
)
use_repo(pip, "rules_mojo_test_deps")
